#include "InitChooseDialog.h"
#include "ui_InitChooseDialog.h"

InitChooseDialog::InitChooseDialog(QWidget * parent, QList<QString> files)
 : QDialog(parent), ui(new Ui::InitChooseDialog)
{
    ui->setupUi(this);
    m_init_choice.clear();
    m_files = files;

    for(int i=0; i < m_files.size(); i++)
        ui->listWidget->addItem(m_files[i]);
}

InitChooseDialog::~InitChooseDialog()
{
}

QList<int> InitChooseDialog::getChoice()
{
    QList<QListWidgetItem *> items = ui->listWidget->selectedItems();
    QList<int> choices;

    if ( items.size() == 2 )
    {
        choices.append(ui->listWidget->row(items[0]));
        choices.append(ui->listWidget->row(items[1]));

        return choices;
    }
    else
    {
        return QList<int>();
    }
}
